import {reqGetAdressList,reqGetTrade} from '@/api/index';

const state = {
    address:[],
    orderInfo:{}
}
const mutations = {
    GETADDRESS(state,address){
        state.address = address;
    },
    GETTRADE(state,trade){
        state.orderInfo = trade;
    }
}
const actions = {
    
   async getAddress({commit}){
       let res = await reqGetAdressList();
       if(res.code == 200){
           commit('GETADDRESS',res.data);
       }
    },
   async getTrade({commit}){
        let res = await reqGetTrade();
        if(res.code ==200){
            commit('GETTRADE',res.data);
        }
    }
}
const getters = {}

export default {
    state,
    mutations,
    actions,
    getters
}